﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;

namespace MySQLQueryMonitor.Util
{
    public static class FontUtil
    {
        public static IEnumerable<FontFamily> GetFontFamilyFromFamilyName(IEnumerable<string> familyNames)
        {
            // Make a family name dictionary
            var dic = Fonts.SystemFontFamilies.ToDictionary(font => font.Source);
            // Convert string representations to FontFamily instances
            return
                from font in familyNames
                where dic.ContainsKey(font)
                select dic[font];
        }
    }
}
